-
Notifications
You must be signed in to change notification settings - Fork 9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add wheel method to Mouse class #6141
feat: add wheel method to Mouse class #6141
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking this on, Christian! Looking good so far.
Please document this in docs/api.md
as well.
563e759
to
72bb067
Compare
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
72bb067
to
204ba10
Compare
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
@mathiasbynens @jackfranklin thanks for the comments. I addressed them and squashed all commits into one. Please let me know if anything is missing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this! Sorry you have to write the docs in two places; hopefully we can finish the migration in the not-too-distant future.
Sounds good! Let me know if there is anything I can do to help. |
@jackfranklin I need some help understanding why the docs test are failing:
They seem to scan the + #### mouse.wheel([options])
+ - `options` <[Object]>
+ - `deltaX` X delta in CSS pixels for mouse wheel event (default: 0).
+ - `deltaY` Y delta in CSS pixels for mouse wheel event (default: 0).
+ - returns: <[Promise]>
+
+ Dispatches a `mousewheel` event. However I don't see any other TS interface options being used anywhere else in that document, e.g. for #### mouse.up([options])
- `options` <[Object]>
- `button` <"left"|"right"|"middle"> Defaults to `left`.
- `clickCount` <[number]> defaults to 1. See [UIEvent.detail].
- returns: <[Promise]>
Dispatches a `mouseup` event. Any advice? |
@christian-bromann ah, this is because the old system that's used to validate the docs doesn't understand the TypeScript source code as well as it should. Given we are migrating away from it I've not invested time into fixing it. So what we do is we basically tell the old doc tool to ignore it, because it doesn't understand. You can see examples of this here: https://github.com/puppeteer/puppeteer/blob/main/utils/doclint/check_public_api/index.js#L746 This is not good, and another reason we're keen to get #6118 done! |
fixes #1679
This patch adds a wheel command to the
Mouse
class. It behaves similar to other mouse commands likeup
ordown
and therefor requires amouse.move(x, y)
for targeting the element properly.An example script to test this feature: